/***************************************************************************************************
 *
 * Project: HZFlashcards
 *
 * Class: ErrorMsgs
 *
 * File name: ErrorMsgs.java
 *
 * Sep 5, 2007
 *
 **************************************************************************************************/

package com.eastmountain.chinese.errormsgs;

import javax.swing.JComponent;
import javax.swing.JOptionPane;

public class ErrorMsgs {

    // TODO maybe pass this into showMessageDialog()

    private static JComponent component;

    public static String ERR_MSG_NO_LESSONS_SELECTED = "No Lessons selected.";

    public static int INFO    = 0;
    public static int WARNING = 1;

    public static String[] msgTypes = { "Info", "Warning" };

    public ErrorMsgs( JComponent component ) {

        ErrorMsgs.component = component;

    }

    static public void showMessageDialog( String message, int msgType ) {

        JOptionPane.showMessageDialog( ErrorMsgs.component,
                                       ErrorMsgs.ERR_MSG_NO_LESSONS_SELECTED,
                                       ErrorMsgs.msgTypes[ msgType ],
                                       JOptionPane.WARNING_MESSAGE );

    }

}
